package com.ktwlsoft.fundmanage.domain.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.CreatedDate;

import javax.persistence.*;
import javax.validation.constraints.Size;
import java.util.Date;

/**
 * 资金进出记录
 *
 * @author Name on 2019/8/20 10:57
 * @version 1.0
 */
@ApiModel("资金进出记录-FundInRecordRepository")
@Entity
@Getter
@Setter
public class FundOutRecord extends BaseFundRecord {

  private static final long serialVersionUID = 1L;

  /**
   * 转出银行
   */
  @ApiModelProperty("转出到/收款银行")
  @Column(columnDefinition = "varchar(200) DEFAULT NULL COMMENT '转出银行'")
  private String expenditureBank;

  /**
   * 转出账号
   */
  @ApiModelProperty("转出到/收款账号")
  @Column(columnDefinition = "varchar(50) DEFAULT NULL COMMENT '转出账号'")
  private String expenditureAccount;

  /**
   * 收款人姓名，即卖方
   */
  @ApiModelProperty("收款人姓名")
  @Column(columnDefinition = "varchar(100) DEFAULT NULL COMMENT '收款人姓名'")
  private String seller;

  /**
   * 出账对账:true.已对账,false.未对账
   */
  @ApiModelProperty("出账对账:true.已对账,false.未对账")
  @Column(columnDefinition = "bit DEFAULT 0 COMMENT '出账对账:true.已对账,false.未对账'")
  private boolean expenditureCheck = false;

  /**
   * 出账对账人Id
   */
  @ApiModelProperty("出账对账人Id")
  @Column(columnDefinition = "varchar(30) DEFAULT NULL COMMENT '出账对账人Id'")
  private String expenditureCheckerId;

  /**
   * 出账对账人姓名
   */
  @ApiModelProperty("出账对账人姓名")
  @Column(columnDefinition = "varchar(30) DEFAULT NULL COMMENT '出账对账人姓名'")
  private String expenditureChecker;

  /**
   * 出账对账时间
   */
  @ApiModelProperty("出账对账时间")
  @Column(columnDefinition = "datetime DEFAULT NULL COMMENT '对账时间'")
  private Date expenditureTime;

  /**
   * 划款时间
   */
  @ApiModelProperty("划款时间")
  @Temporal(TemporalType.TIMESTAMP)
  @Column(nullable = false, updatable = false)
  private Date transferApplyTime;


  @ApiModelProperty("银行流水号")
  @Column(length = 50)
  private String bankFlowCode;

  /**
   * 资金进出记录id
   */
  @ApiModelProperty("资金进出记录id")
  @Column(name = "fund_in_id", columnDefinition = "bigint(30) NOT NULL COMMENT '资金进出记录id'")
  protected Long fundInId = 0L;

  /**
   * 划款方式
   */
//  @Enumerated(EnumType.STRING)
  @ApiModelProperty("划款方式")
  @Column(length = 30)
  private String transferType;

  /**
   * 监管银行名称
   */
  @ApiModelProperty("监管银行名称")
  @Transient
  private String bankName;

  /**
   * 监管银行账号(资金入账账号)
   */
  @ApiModelProperty("监管银行账号(资金入账账号)")
  @Transient
  private String bankCardNum;

  /**
   * 划款方式
   */
  public enum TransferType{
    /**
     * 支票
     */
    CHECK,
    /**
     * 网银
     */
    NET;
  }


}
